From: Richard M. Stallman Date: Fri, 17 Jun 1994 23:34:37 +0000 (+0000) Subject: (x_real_positions): Make sure we know the parent window. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~91116 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=043835a3bafbb260263c9311ad4b3733d39937ef;p=emacs.git (x_real_positions): Make sure we know the parent window. --- diff --git a/src/xfns.c b/src/xfns.c index 00f0f2055a1..a8bcc81cc51 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -570,6 +570,23 @@ x_real_positions (f, xptr, yptr) int win_x = 0, win_y = 0; Window child; + /* This is pretty gross, but seems to be the easiest way out of + the problem that arises when restarting window-managers. */ + +#ifdef USE_X_TOOLKIT + Window outer = XtWindow (f->display.x->widget); +#else + Window outer = f->display.x->window_desc; +#endif + Window tmp_root_window; + Window *tmp_children; + int tmp_nchildren; + + XQueryTree (x_current_display, outer, &tmp_root_window, + &f->display.x->parent_desc, + &tmp_children, &tmp_nchildren); + xfree (tmp_children); + /* Find the position of the outside upper-left corner of the inner window, with respect to the outer window. */ if (f->display.x->parent_desc != ROOT_WINDOW)